﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BiliBiliCSharpStudy.ch30.d05 {
    class HelloGenericInterface1 {
        public static void Demo() {
            Student<int> stu = new Student<int>();
            stu.ID = 101;
            stu.Name = "Timothy";
            Student<ulong> stu2 = new Student<ulong>();
            stu2.ID = 10000000000001;
            stu2.Name = "Timothy";
        }
    }

    interface IUnique<TId> {
        TId ID { get; set; }
    }

    /**
     * 泛型接口
     * 泛型类
     */
    class Student<TId> : IUnique<TId> {
        public TId ID { get; set; }
        public string Name { get; set; }
    }
}
